package com.dyava.commons.validate;

public class ValidateDouble extends Validate<Double,ValidateDouble> {
	
	public ValidateDouble(Double value,String name) {
		this.value = value;
		this.name = name;
	}

	
	public ValidateDouble gt(double value){
		if (checkNull()) return this;
		if(this.value>value){
			return this;
		}
		throw new ValidateFastException(name+"必须大于"+value);
	}
	
	public ValidateDouble lt(double value){
		if (checkNull()) return this;
		if(this.value<value){
			return this;
		}
		throw new ValidateFastException(name+"必须小于"+value);
	}
	
	public ValidateDouble ge(double value){
		if (checkNull()) return this;
		if(this.value>=value){
			return this;
		}
		throw new ValidateFastException(name+"必须大于等于"+value);
	}
	
	public ValidateDouble le(double value){
		if (checkNull()) return this;
		if(this.value<=value){
			return this;
		}
		throw new ValidateFastException(name+"必须小于等于"+value);
	}
	
	
	
	
}
